import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class StepperDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => StepperState();
}

class StepperState extends State<StepperDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Stepper'),
        centerTitle: true,
      ),
      body: Container(
        padding: EdgeInsets.all(15),
        child: Column(
          children: <Widget>[
            Stepper(steps: [
              Step(
                  //title
                  title: Text('标题一'),
                  //副标题
                  subtitle: Text('副标题一'),
                  //状态
                  state: StepState.indexed,
                  //是否高亮isActive
                  isActive: true,
                  content: Container(
                    child: Text('内容一'),
                    color: Colors.orangeAccent.withOpacity(0.4),
                  )),
              Step(
                  title: Text('标题二'),
                  //副标题
                  subtitle: Text('副标题二'),
                  //状态
                  state: StepState.editing,
                  content: Container(
                    child: Text('内容二'),
                    color: Colors.orangeAccent.withOpacity(0.4),
                  )),
              Step(
                  title: Text('标题三'),
                  //副标题
                  subtitle: Text('副标题三'),
                  //状态
                  state: StepState.complete,
                  content: Container(
                    child: Text('内容三'),
                    color: Colors.orangeAccent.withOpacity(0.4),
                  )),
              Step(
                  title: Text('标题四'),
                  //副标题
                  subtitle: Text('副标题四'),
                  //状态
                  state: StepState.disabled,
                  content: Container(
                    child: Text('内容四'),
                    color: Colors.orangeAccent.withOpacity(0.4),
                  )),
              Step(
                  title: Text('标题五'),
                  //副标题
                  subtitle: Text('副标题五'),
                  //状态
                  state: StepState.error,
                  content: Container(
                    child: Text('内容五'),
                    color: Colors.orangeAccent.withOpacity(0.4),
                  )),
            ])
          ],
        ),
      ),
    );
  }
}
